package domain;

public class TipoLinkIn {
    private Root root;
    private File file;

    public TipoLinkIn(Root theRoot, File theFile) throws EccezionePrecondizioni{
        if(theRoot == null || theFile == null)
            throw new EccezionePrecondizioni("Gli oggetti devono essere inizializzati");
        root = theRoot;
        file = theFile;
    }

    /**
     * @return the theRoot
     */
    public Root getRoot() {
        return root;
    }

    /**
     * @return the theFile
     */
    public File getFile() {
        return file;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final TipoLinkIn other = (TipoLinkIn) obj;
        if (this.root != other.root && (this.root == null || !this.root.equals(other.root))) {
            return false;
        }
        if (this.file != other.file && (this.file == null || !this.file.equals(other.file))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 29 * hash + (this.root != null ? this.root.hashCode() : 0);
        hash = 29 * hash + (this.file != null ? this.file.hashCode() : 0);
        return hash;
    }
    
    
}
